<template>
  <div>
    <el-container style="color:white">
      <el-aside :width="homedata.leftWidth + 'px'"
                style="line-height: 60px;border-right: 1px solid gray;padding-left: 20px;">

        <span style="font-size: 40px">
          <template v-if="homedata.leftWidth == 200">
            1606D
          </template>
          <template v-else>
            <i class="iconfont icon-ku" style="font-size: 40px"></i>
          </template>
        </span>
      </el-aside>
      <el-main>
        <el-row>
          <el-col :span="12">
            <el-menu :default-active="activeIndex" mode="horizontal" @select="selectNav" background-color="#409EFF"
                     text-color="#fff" active-text-color="#F4C66E">
              <el-menu-item index="1">
                <i :class="['iconfont',isShouqi] " style="font-size: 25px;color: white"></i>
              </el-menu-item>
              <el-menu-item index="2">系统介绍</el-menu-item>
              <el-menu-item index="3">项目</el-menu-item>
              <el-menu-item index="4">文档</el-menu-item>
              <el-menu-item index="5">博客</el-menu-item>
            </el-menu>
          </el-col>

          <el-col :span="12" style="display: flex;justify-content:flex-end;">
            <el-menu :default-active="ractiveIndex" mode="horizontal" @select="selectNav2" background-color="#409EFF"
                     text-color="#fff" active-text-color="#F4C66E">
              <el-menu-item index="1">
                <el-badge :value="12" style="line-height: 25px">
                  <i class="iconfont icon-tixing" style="font-size: 30px;color: white"></i>
                </el-badge>
              </el-menu-item>

              <el-menu-item index="2" style="padding-right: 20px;">
                <el-popover placement="bottom" width="300" popper-class="abc" trigger="click" :visible-arrow="false">
                  <UserInfo/>
                  <div slot="reference">
                    admin &nbsp;&nbsp;
                    <img src="../assets/yasuo.png" height="40px" width="40px"
                         style="border-radius: 40px;border: 1px solid white">
                  </div>
                </el-popover>
              </el-menu-item>
            </el-menu>
          </el-col>

        </el-row>

      </el-main>
    </el-container>


  </div>
</template>
<script>
  import UserInfo from "@/components/UserInfo.vue"

  export default {
    components: {
      UserInfo
    },
    props: ["homedata"],
    data() {
      return {
        activeIndex: "1",
        ractiveIndex: "10",
        isShouqi: "icon-shouqi"
      }

    },
    methods: {
      //选中导航
      selectNav(key, keyPath) {
        if (key == 1) {
          if (this.isShouqi == "icon-shouqi") {
            this.homedata.leftWidth = 80;
            this.homedata.isCollapse = true;
            this.isShouqi = "icon-zhankai";
          } else {
            this.homedata.leftWidth = 200;
            this.homedata.isCollapse = false;
            this.isShouqi = "icon-shouqi";
          }

        }

      },
      //选中右边导航
      selectNav2(key, keyPath) {
        console.log(key);
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

  .el-main {
    padding: 0;
  }
</style>
